package com.ruoyi.system.service.impl;

import java.util.Collections;
import java.util.List;

import com.ruoyi.system.domain.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StaffMapper;
import com.ruoyi.system.service.IStaffService;

/**
 * 员工管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-11
 */
@Service
public class StaffServiceImpl implements IStaffService 
{
    @Autowired
    private StaffMapper staffMapper;

    /**
     * 查询员工管理
     * 
     * @param staffId 员工管理主键
     * @return 员工管理
     */
    @Override
    public Staff selectStaffByStaffId(Long staffId)
    {
        return staffMapper.selectStaffByStaffId(staffId);
    }

    @Override
    public List<Long> selectCount() {
        return staffMapper.selectCount();
    }

    /**
     * 查询员工管理列表
     * 
     * @param staff 员工管理
     * @return 员工管理
     */
    @Override
    public List<Staff> selectStaffList(Staff staff)
    {
        return staffMapper.selectStaffList(staff);
    }

    @Override
    public List<Property> selectPropertyList() {
        return staffMapper.selectPropertyList();
    }

    @Override
    public List<Time> selectTimeList() {
        return staffMapper.selectTimeList();
    }

    /**
     * 新增员工管理
     * 
     * @param staff 员工管理
     * @return 结果
     */
    @Override
    public int insertStaff(Staff staff)
    {
        staffMapper.insertStaff(staff);
        return Math.toIntExact(staff.getStaffId());
    }

    @Override
    public int insertStaffProperty(List<StaffProperty> staffPropertyList) {
        return staffMapper.insertStaffProperty(staffPropertyList);
    }

    @Override
    public int insertStaffTime(List<StaffTime> staffTimeList) {
        return staffMapper.insertStaffTime(staffTimeList);
    }

    /**
     * 修改员工管理
     * 
     * @param staff 员工管理
     * @return 结果
     */
    @Override
    public int updateStaff(Staff staff)
    {
        return staffMapper.updateStaff(staff);
    }

    @Override
    public int deleteProperty(Long staffId) {
        return staffMapper.deleteProperty(staffId);
    }

    @Override
    public int deleteTime(Long staffId) {
        return staffMapper.deleteTime(staffId);
    }

    /**
     * 批量删除员工管理
     * 
     * @param staffIds 需要删除的员工管理主键
     * @return 结果
     */
    @Override
    public int deleteStaffByStaffIds(Long[] staffIds)
    {
        return staffMapper.deleteStaffByStaffIds(staffIds);
    }

    /**
     * 删除员工管理信息
     * 
     * @param staffId 员工管理主键
     * @return 结果
     */
    @Override
    public int deleteStaffByStaffId(Long staffId)
    {
        return staffMapper.deleteStaffByStaffId(staffId);
    }
}
